<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ID号输入</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#3B82F6',
                        secondary: '#64748B',
                        neutral: '#F1F5F9',
                    },
                    fontFamily: {
                        sans: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .input-focus {
                @apply focus:ring-2 focus:ring-primary/50 focus:border-primary transition-all duration-200;
            }
        }
    </style>
</head>
<body class="bg-gray-50 min-h-screen flex items-center justify-center p-4">
    <div class="w-full max-w-md bg-white rounded-xl shadow-lg p-6 md:p-8 border border-gray-100">
        <div class="mb-6 text-center">
            <h2 class="text-[clamp(1.5rem,3vw,2rem)] font-bold text-gray-800">ID号输入</h2>
            <p class="text-gray-500 mt-2">输入您的ID号以继续</p>
        </div>
        
        <form id="idForm" class="space-y-5">
            <div class="relative">
                <div class="flex items-center gap-2">
                    <label for="id" class="text-sm font-medium text-gray-700 whitespace-nowrap">输入id号</label>
                    <input type="text" id="id" name="id" placeholder="请输入" 
                        class="flex-1 min-w-0 block w-full px-4 py-2.5 text-gray-700 bg-white border border-gray-300 rounded-lg input-focus outline-none"
                        required>
                </div>
                <p id="idError" class="mt-1 text-sm text-red-500 hidden">请输入有效的ID号</p>
            </div>
            
            <button type="submit" 
                class="w-full bg-primary hover:bg-primary/90 text-white font-medium py-2.5 px-4 rounded-lg transition-all duration-200 transform hover:scale-[1.02] active:scale-[0.98] shadow-md hover:shadow-lg flex items-center justify-center gap-2">
                <span>确认</span>
                <i class="fa fa-arrow-right"></i>
            </button>
        </form>
        
        <div class="mt-6 text-center text-sm text-gray-500">
            <p>如有问题，请联系 <a href="mailto:support@example.com" class="text-primary hover:underline">技术支持</a></p>
        </div>
    </div>

    <script>
        document.getElementById('idForm').addEventListener('submit', function(e) {
            e.preventDefault();
            const idInput = document.getElementById('id');
            const idValue = idInput.value.trim();
            
            // 简单验证ID号（这里只是示例，实际应用中可能需要更复杂的验证）
            if (idValue === '') {
                showError('idError', 'ID号不能为空');
                return;
            }
            
            if (idValue.length < 6) {
                showError('idError', 'ID号长度不能少于6位');
                return;
            }
            
            // 验证通过，可以进行后续操作
            hideError('idError');
            alert(`您输入的ID号是: ${idValue}`);
            // 这里可以添加AJAX请求等操作
        });
        
        function showError(elementId, message) {
            const errorElement = document.getElementById(elementId);
            errorElement.textContent = message;
            errorElement.classList.remove('hidden');
            errorElement.classList.add('animate-pulse');
            setTimeout(() => {
                errorElement.classList.remove('animate-pulse');
            }, 1000);
        }
        
        function hideError(elementId) {
            document.getElementById(elementId).classList.add('hidden');
        }
        
        // 添加输入框的实时验证
        document.getElementById('id').addEventListener('input', function() {
            hideError('idError');
        });
    </script>
</body>
</html>
    